package com.sqx.modules.task.service;


import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.sqx.common.utils.Result;
import com.sqx.modules.task.entity.HelpTake;
import com.sqx.modules.utils.excel.ExcelData;

import java.math.BigDecimal;
import java.util.HashMap;
import java.util.List;

public interface HelpTakeService extends IService<HelpTake> {

    Result selectHelpTake(int page, int limit);

    Result selectRunHelpOrder(int page,int limit,Integer status,Integer taskType,String orderNo,String phone,
                              String startTime,String deliveryTime,Long userId,String content,String gameId,String name);

    Result selectRunHelpOrder(int page, int limit, Integer status, String phone, String startTime, String endTime,
                              Integer taskType, Long rideUserId,String rideName);


    HelpTake selectHelpTakeById(Long helpTakeId);

    Integer countHelpTakeByCreateTime(String time,Integer flag);

    Double sumMoneyBySend(String time,Integer flag);

    Result saveBody(HelpTake helpTake);

    Result endHelpTake(Long id,Long userId);

    Result closeOrder(Long helpTakeId,Long helpOrderId,String code,String endTaskImg,String endTaskAddress,String endTaskLongitude,String endTaskLatitude,int type);

    Result closeOrders(Long helpOrderId);

    Result updateHelpTakeById(HelpTake helpTake);

    Result deleteById(Long id);


    Result offerOrder(Long id, BigDecimal offerMoney,Integer userType, Long userId);

    Result startHelperOrder(Long helpOrderId, Long userId, String startTaskImg, String startTaskAddress, String startTaskLongitude, String startTaskLatitude);
    IPage<List<HashMap<String, Object>>> orderStatistics(Integer page, Integer limit, Long companyId, String phone, String userName, String startTime, String endTime);

    IPage<HashMap<String, Object>> getMyOfferOrder(Integer page, Integer limit, Integer status,Long userId);

    HashMap<String ,Object> getCompanyOrderCount(Long userId);

    IPage<HashMap<String, Object>> getCompanyOrder(Integer page, Integer limit,Integer status, Long userId,Long companyId,Long userIds);

    Result distributionOrder(Long companyId,Long takeId);

    IPage<HashMap<String, Object>> getStaffOrder(Integer page, Integer limit, Long userId);

    IPage<HashMap<String,Object>> getStaffUserHelp(Integer page, Integer limit, Long companyId);

    ExcelData helpTakeListExcel(Integer status, String phone, String startTime, String endTime, Integer taskType, Long rideUserId, String rideName);

    Result adminDistributionOrder(Long orderId, Long userId);

    Integer selectHelpTakeCountByUserId(Long userId,Integer status,String startTime,String endTime);

    Double selectHelpTakeMoneyCountByUserId(Long userId,Integer type);

}
